import Vue from 'vue'
import Router from 'vue-router'
import Layout from '../layout/index'

Vue.use(Router)

export const constantRouterMap = [
  {
    path: '/login',
    meta: { title: '登录', noCache: true },
    component: (resolve) => require(['@/views/login'], resolve),
    hidden: true
  },
  {
    path: '/404',
    component: (resolve) => require(['@/views/features/404'], resolve),
    hidden: true
  },
  {
    path: '/401',
    component: (resolve) => require(['@/views/features/401'], resolve),
    hidden: true
  },
  {
    path: '/redirect',
    component: Layout,
    hidden: true,
    children: [
      {
        path: '/redirect/:path*',
        component: (resolve) => require(['@/views/features/redirect'], resolve)
      }
    ]
  },
  {
    path: '/',
    component: Layout,
    // redirect: '/dashboard',
    redirect: '/Notice',
    children: [
      // {
      //   path: 'dashboard',
      //   component: (resolve) => require(['@/views/home'], resolve),
      //   name: 'Dashboard',
      //   meta: { title: '首页', icon: 'index', affix: true, noCache: true }
      // },
      {
        path: 'Notice',
        component: (resolve) => require(['@/views/Notice'], resolve),
        name: 'Notice',
        meta: { title: '公告', icon: 'index', affix: true, noCache: true }
      }
    ]
  },
  // {
  //   path: '/finance',
  //   component: Layout,
  //   redirect: '/finance',
  //   children: [
  //     {
  //       path: 'financeBankBalanceReport',
  //       component: (resolve) => require(['@/views/erp/financeBankBalanceReport/index'], resolve),
  //       name: 'financeBankBalanceReport',
  //       meta: { title: '银行余额明细', icon: 'index', affix: true, noCache: true }
  //     }
      // {
      //   path: 'financeBankInOutBorrowInDetail/:id',
      //   component: (resolve) => require(['@/views/erp/financeBankInOut/borrowInDetail'], resolve),
      //   name: 'financeBankInOutBorrowInDetail',
      //   meta: { title: '银行收支单-内部借款', icon: 'index', affix: true, noCache: true }
      // },
      // {
      //   path: 'financeBankInOutPayInDetail/:id',
      //   component: (resolve) => require(['@/views/erp/financeBankInOut/payInDetail'], resolve),
      //   name: 'financeBankInOutPayInDetail',
      //   meta: { title: '银行收支单-内部还款', icon: 'index', affix: true, noCache: true }
      // },
      // {
      //   path: 'financeBankInOutTransferDetail/:id',
      //   component: (resolve) => require(['@/views/erp/financeBankInOut/transferDetail'], resolve),
      //   name: 'financeBankInOutTransferDetail',
      //   meta: { title: '银行收支单-转账', icon: 'index', affix: true, noCache: true }
      // }
    // ]
  // }
]

export default new Router({
  mode: 'history',
  scrollBehavior: () => ({ y: 0 }),
  routes: constantRouterMap
})
